home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
scl120
/
ssg.doc
< prev
next >
Wrap
Text File
|
1990-04-21
|
72KB
|
1,897 lines
[27][6]
SSG - SCREEN EDITOR AND PROGRAM GENERATOR
REFERENCE MANUAL
COPYRIGHT (C) 1989, 1990 BY:
JOSE RODRIGUEZ ALVIRA
AND
JOSE R. LEBRON
SSG Version 2.0 - Reference Manual
TABLE OF CONTENTS
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . 1
HARDWARE REQUIREMENTS . . . . . . . . . . . . . . . . . . . 1
INSTALLING SSG . . . . . . . . . . . . . . . . . . . . . . . 1
STARTING SSG . . . . . . . . . . . . . . . . . . . . . . . . 1
THE STATUS BOX . . . . . . . . . . . . . . . . . . . . . . . 1
Moving the STATUS BOX: . . . . . . . . . . . . . . . . 2
Turning STATUS BOX on and off: . . . . . . . . . . . . 2
STATUS BOX First Line: . . . . . . . . . . . . . . . . 2
STATUS BOX Second Line: . . . . . . . . . . . . . . . . 2
STATUS BOX third, fourth fifth and sixth Lines: . . . . 3
USING SSG . . . . . . . . . . . . . . . . . . . . . . . . . 3
Writing a character or symbol: . . . . . . . . . . . . 3
Moving the cursor: . . . . . . . . . . . . . . . . . . 4
Changing the cursor movement direction: . . . . . . . . 4
Block operations: . . . . . . . . . . . . . . . . . . . 4
SSG MENUS . . . . . . . . . . . . . . . . . . . . . . . . . 5
Main Menu . . . . . . . . . . . . . . . . . . . . . . . 5
Load . . . . . . . . . . . . . . . . . . . . . . . 5
Save . . . . . . . . . . . . . . . . . . . . . . . 6
New . . . . . . . . . . . . . . . . . . . . . . . 6
Save SSG 1.0 . . . . . . . . . . . . . . . . . . . 6
Options . . . . . . . . . . . . . . . . . . . . . 6
Quit . . . . . . . . . . . . . . . . . . . . . . . 6
Edit Menu . . . . . . . . . . . . . . . . . . . . . . . 6
Center Block . . . . . . . . . . . . . . . . . . . 7
Copy Block . . . . . . . . . . . . . . . . . . . . 7
Delete Block . . . . . . . . . . . . . . . . . . . 7
Fill Block . . . . . . . . . . . . . . . . . . . . 8
Move Block . . . . . . . . . . . . . . . . . . . . 8
Shadow Block . . . . . . . . . . . . . . . . . . . 8
Transfer Block . . . . . . . . . . . . . . . . . . 8
Draw Box . . . . . . . . . . . . . . . . . . . . . 8
Draw Line . . . . . . . . . . . . . . . . . . . . 9
Draw Box Line . . . . . . . . . . . . . . . . . . 9
Source Menu . . . . . . . . . . . . . . . . . . . . . . 9
Define Color Variables . . . . . . . . . . . . . . 9
Generate Screen . . . . . . . . . . . . . . . . . 10
Generating Source Files . . . . . . . . . . . . . 11
Page -2-
SSG Version 2.0 - Reference Manual
TABLE OF CONTENTS
Video Menu . . . . . . . . . . . . . . . . . . . . . . 17
Select Color . . . . . . . . . . . . . . . . . . . 17
Pick Screen Color . . . . . . . . . . . . . . . . 17
Modify Block Color . . . . . . . . . . . . . . . . 18
Block to Default Color . . . . . . . . . . . . . . 18
Switch Screen . . . . . . . . . . . . . . . . . . 18
View . . . . . . . . . . . . . . . . . . . . . . . 18
Change Video Mode . . . . . . . . . . . . . . . . 18
STEP BY STEP EXAMPLE . . . . . . . . . . . . . . . . . . . . 18
Example #1 - Menu . . . . . . . . . . . . . . . . . . . 19
Example #2 - MenuSystem . . . . . . . . . . . . . . . . 21
Example #3 - Fields2 . . . . . . . . . . . . . . . . . 24
LICENSE . . . . . . . . . . . . . . . . . . . . . . . . . . 28
DISCLAIMER . . . . . . . . . . . . . . . . . . . . . . . . . 28
Page -3-
SSG Version 2.0 - Reference Manual
OVERVIEW
SSG (SCL1 Screen Generator) is a full-screen, extended ASCII
editor that will help you design your programs screens. SSG can
also generate the data, structures and code from the information
of your screens for use in programs written using the SCL1
Library functions. SSG has color and mouse support and can save
and load your program's screen files with full color information.
Video modes such as 80 x 25 and 40 x 25 as well as EGA 80 x 43
and VGA 80 x 50 modes are supported. You will have full control
of the generated source by indicating SSG exactly how you want
the code written.
This document will guide you through the creation of screens and
the generation of source code from the screens. SSG is easy to
use but, in order to get the most out of it, you must learn how
to make use of all its features. The time you spend learning SSG
will save you a lot of programming time.
HARDWARE REQUIREMENTS
SSG will run in most MS/PC DOS computers. The program requires at
least 320k of free memory and DOS 2.0 and above. No graphics
display adapter is required as SSG works in the text mode. A
mouse is recommended to get the most out of SSG.
INSTALLING SSG
There is no need to perform a special installation of SSG. The
program is contained in one file. SSG will write a configuration
file containing the default parameters and color information.
The only installation required is to copy the SSG.EXE file to the
working directory or disk.
STARTING SSG
To start SSG, type SSG (specify program file drive and path if
necessary) and press ENTER. Once you see SSG's welcome screen,
press any key or press the mouse's left button to begin. The
screen will clear and the STATUS BOX will appear in the screen
lower left corner.
THE STATUS BOX
The STATUS BOX is your interface with the program, it will give
you very important information and will let you select the
various options available. The STATUS BOX will look something
like this:
Page -1-
SSG Version 2.0 - Reference Manual
+-------------|STATUS BOX|-------------+
1st Line | Main Edit Source Video F1 Help | <-- Menu
2nd Line | CURSOR 0 0 -> MOUSE 0 0 +---+ |
3rd Line | ABCDEFGHIJKLMNOPQRSTUVWXYZ | | | <-- Current
4th Line | ^ +---+ | Character
| +---+ |
5th Line | abcdefghijklmnopqrstuvwxyz | | | <-- Block
6th Line | +---+ | Icon
+--------------------------------------+
Moving the STATUS BOX:
The STATUS BOX can be moved to any place in the screen
by pressing ALT+U, D, R or L (for up, down, right and
left). You can also move it by pressing (and keeping
pressed) the mouse's left button after pointing to the
STATUS BOX title at the top of the box and dragging the
mouse.
Turning STATUS BOX on and off:
The STATUS BOX can be turned on or off by pressing the
F9 key or by clicking the mouse's right button.
STATUS BOX First Line:
The STATUS BOX's first line contain the available menus.
Four menus are included; Main, Edit Source and Video. You
can also ask for help with the help option.
STATUS BOX Second Line:
The STATUS BOX's second line contains the following:
CURSOR - Displays the current text cursor position. The
screen's right top corner coordinates are 0,0.
CURSOR DIRECTION - The arrow between the text cursor status
marker and the mouse cursor status marker shows the
direction the cursor will move after writing a character.
MOUSE - Displays the mouse cursor position.
CURRENT CHARACTER BOX - Shows the selected character.
Page -2-
SSG Version 2.0 - Reference Manual
STATUS BOX third, fourth fifth and sixth Lines:
The third row and fifth lines show the keyboard layout, this
lines are static. Below each keyboard character the
corresponding character that will be drawn is shown. This
translation table shows which symbol is assigned to which
keyboard key. For example, in the startup translation
table, if you press "A" a vertical line will appear at the
cursor position. After typing a character the cursor will
move up, down, left or right depending on how you have set
the current cursor direction option. You have four keyboard
translation tables available. To toggle among them use the
F4 key or click the mouse after pointing to the double arrow
icon (fourth row at the left).
BLOCK ICON - The block icon at the right of the fifth line
is for selecting a block with the mouse.
USING SSG
Now that you are familiar with the STATUS BOX, let us explore
SSG's basic editing operations.
Writing a character or symbol:
To write a character or symbol at the current cursor
position, press the key that corresponds to the desired
symbol or character. The symbol or character written
to the screen will depend on the current keyboard
translation table. The cursor will advance one
character position to the direction indicated by the
cursor increment icon in the STATUS BOX. If you have a
mouse you can "pick" a desired character or symbol from
the STATUS BOX and write it to the screen location
where the mouse is clicked. The symbol you have
selected will appear in the current character box at
the right of the STATUS BOX's third line. This will
remind you of what is the selected a symbol. To
"un-select" the character, click the mouse's left
button at current character box. If you do not have a
mouse, you can "pick" a character or symbol by placing
the text cursor over the character and pressing
SHIFT+F4.
Page -3-
SSG Version 2.0 - Reference Manual
Moving the cursor:
The cursor can be moved by using the arrow keys. The
Home, End, PgUp and PgDn keys move the cursor
diagonally. The F5, F6, F7, F8 and TAB keys move the
cursor several spaces at a time. You can place the
text cursor to the current mouse cursor position by
pressing the right mouse button while holding the left
button pressed.
Changing the cursor movement direction:
After writing a character the cursor will move in the
direction indicated by the cursor movement icon (an
arrow next to the text cursor position display). You
can change the default right direction by pressing F3
or by clicking the left button at this icon.
Block operations:
SSG's most powerful editing operations are performed
using marked blocks. Once a block is marked you can
move, edit, color, etc. the information inside the
block.
Marking Blocks:
With the keyboard:
Press F10 (Mark Block). The cursor size changes to
a block and the STATUS BOX will disappear. Move
the cursor to one of the block corners. Press
ENTER, the cursor will stop blinking. Now use the
cursor movement keys to enlarge the highlighted
area to the desired size. Press ENTER and the
block is marked. A block remains marked until you
mark a new block.
With the mouse:
Click the mouse left button after pointing to the
Block Icon. The STATUS BOX will disappear from
the screen. Move the mouse cursor to one of the
block corners. Press the mouse's left button and,
without releasing it, drag the mouse to the
block's opposite corner. Release the mouse button
and the block is marked.
Page -4-
SSG Version 2.0 - Reference Manual
SSG MENUS
Main Menu
To select the Main Menu press the ALT+M keyboard combination or
click your mouse after pointing to the Main keyword in the STATUS
BOX. When you select this option the following menu will pop in
a window:
+-----|Main|-----+
| Load |
| Save |
| New |
| |
| Save SSG 1.0 |
| |
| Options |
| |
| Quit |
+----------------+
The available options are:
Load
Permits you to load screens saved in SSG compatible file
format. A file box will appear showing all files that match
the search string, sorted by name and extension.
Subdirectories will be preceded by "<". If you select a
subdirectory, it will be added to the search string. You can
edit the search string at any time. The search string
initially is "*.SSG" (or the default extension you have set
with "Options").
To load a file you first highlight its filename using the
arrow keys or your mouse and the press ENTER or click your
mouse after pointing to the "LOAD" button. You can also
select a file by double clicking your mouse after pointing
to the desired name. You can cancel the operation by
pressing the ESC key or clicking the mouse after pointing to
the CANCEL button.
Page -5-
SSG Version 2.0 - Reference Manual
Save
SSG can save your screen files with all its color
information. Enter the file name and path. SSG will warn
you if a file already exists with the same name. If you had
set the "Create Backup" option (see "Options" in this menu),
SSG renames the old copy with the .BAK extension. If you
don't specify an extension SSG adds the default extension
specified with "Default Extension" (see "Options"). If you
want your file without extension add a period to the end of
its name.
New
Erase the buffer contents and start a new screen. All the
screen information will be lost unless you save it to disk.
Save SSG 1.0
This version of SSG uses a different file format than
previous versions. The SSG files now contains a header with
the screen mode information and the files are compressed.
SSG will recognize the screen files created by previous
versions of SSG. Use this option if you want to save the
files in the older format. File compression can reduce the
file size from 5 to 20%.
Options
This option will permit you to set the default file
Load/Save options. You will be able to specify the default
extension for SSG files and wether you want or not to make
backup of files.
Quit
Use this option to quit SSG. If the screen contents or the
generated source code have not been saved you will be
prompted if you want to do so before exiting.
Edit Menu
To select the Edit Menu press the ALT+E keyboard combination or
click your mouse after pointing to the Edit keyword in the STATUS
BOX. When you select this option the following menu will pop in
a window:
Page -6-
SSG Version 2.0 - Reference Manual
+-------|Edit|------+
| Center Block |
| Copy Block |
| Delete Block |
| Fill Block |
| Move Block |
| Shadow Block |
| Transfer Block |
| |
| Draw Box |
| Draw Line |
| Draw Box Line |
+-------------------+
Center Block
This option is used to center the marked block. When you
select this option a window will pop into the screen
prompting you how to center the block. The options are
Horizontal, Vertical or Both. After making a selection the
marked block will be highlighted, press ENTER or the mouse's
left button to center it, you can cancel the operation by
pressing ESC or the mouse's right button.
Copy Block
You can make copies of a block and place the copy anywhere
in the screen. To perform this operation select "Copy
Block" from the menu. Move the copied block to the desired
position using the cursor movement keys and press ENTER.
With the mouse, press the mouse's left button and drag the
block to it's new position.
Delete Block
This option will delete all the information included in the
marked block, clearing the area. You can also use this
option to change the color of the marked area. To change the
area color, select the color you want using the "Select
Color" option of the Video Menu and then delete the block.
As with most block operations the marked block will be
highlighted. Press ENTER or the mouse's left button to
delete the block or press ESC or the mouse's right button to
cancel. The block will be painted with the selected color
(all the information inside the block will be erased).
Page -7-
SSG Version 2.0 - Reference Manual
Fill Block
This option will let you fill the block with a selected
character. You must first select the character to be used
for filling the block. To select a character you can "pick"
it form the STATUS BOX with your mouse or pressing the
SHIFT+F4 key combination after placing the text cursor over
the desired character. Then select the "Fill Block" option,
the STATUS BOX will disappear. If you press ENTER of the
left mouse button the block will be filled, if you press ESC
or the right mouse button the operation will be canceled.
Move Block
You can move a block anywhere in the screen. To perform this
operation select "Move Block" from the menu. Move the block
to the desired position using the cursor movement keys and
press ENTER. With the mouse, press the mouse's left button
and drag the block to it's new position. Block movement does
not destroy the background.
Shadow Block
This option lets you add a shadow effect to the current
block. When you select this option a window will pop with
the different shadow options available. You can add a Solid
Shadow, XORed shadow with current color XORed or an XORed
shadow with the default color.
Transfer Block
This option lets you transfer a block form the current
screen to the alternate screen. The alternate screen is
selected form the Video Menu. To transfer a block, switch
screens and then select the Transfer Block option. The
block will be copied to the alternate screen.
Draw Box
This option lets you draw a box around the marked block. A
window will pop into the screen showing the different kinds
of frames available. Select one by moving the little arrow
above the boxes using the arrow keys or by clicking the
mouse at the desired type of box. The Box will appear. To
accept it press ENTER or click the mouse's left button. If
you press ESC or click the mouse's right button the box will
disappear.
Page -8-
SSG Version 2.0 - Reference Manual
Draw Line
This option will permit you to draw a single line (or the
character or symbol selected). Mark the block area with one
column position (for vertical lines) or one row position
(for horizontal lines).
Draw Box Line
This option will permit you to draw lines inside boxes.
Mark the area where the line is to be drawn. The line will
be drawn with the correct line termination characters.
Source Menu
To select the Source Menu press the ALT+S keyboard combination or
click your mouse after pointing to the Source keyword in the
STATUS BOX. When you select this option the following menu will
pop in a window:
+---------|Source|---------+
| Define Color Variables |
| |
| Generate Screen |
+--------------------------+
Define Color Variables
This option will permit you to set the color variables to be
used with the generated program. The following window will
pop into the screen:
+-----------------------------+
| Defined color variables: |
| |
| Color3 |
| Color4 |
| HColor |
| NColor |
| RColor |
| |
| |
| |
| |
| |
+-----------------------------+
| = ADD = = EDIT = |
| |
| = DELETE = = OK = |
+-----------------------------+
Page -9-
SSG Version 2.0 - Reference Manual
The window will contain a list of the defined color
variables. You can add, edit or delete color variables to
the list. When you select the ADD option, you will be
prompted for a variable name. After typing the variable
name a Color Selection Menu will appear in the screen. Use
your keyboard or the mouse to select the desired color. The
new variable will be added to the list. With the EDIT
option, you can change a selected color variable. You will
be prompted for a variable name and the color selection
process is as for the ADD option. The DELETE option will
delete the selected variable from the list. The OK option
will remove the window form the screen and will save the
color variables.
When SSG generates source code it can write the actual color
values or use predefined variables (see GENERATE SOURCE).
The following default variables have been defined: NColor
(white characters on a black background), RColor (black
characters on a white background) and HColor (highlighted
white characters on a black background). These variables
names will be used by SSG when generating the source code.
In case you have a used a color that has not been defined
SSG will write "unknown_?" (the "?" being the actual color
value) to your source code.
Generate Screen
This option is used for beginning the program generation
process. The following window will appear in the screen:
+-------------------------------+
| Generate coordinates using: |
| |
| (X) Actual coordinates |
| ( ) #define |
+-------------------------------+
| Generate colors using: |
| |
| (X) Predefined variables |
| ( ) Actual values |
+-------------------------------+
| |
| ( ) Add headers files |
| ( ) Add Color variables |
| |
| = OK = = CANCEL = |
+-------------------------------+
Page -10-
SSG Version 2.0 - Reference Manual
This window contains the general information about the way
the source code will be generated. The default options are
marked with a check mark. To toggle an option on or off
press the SPACEBAR or click the left mouse button after
placing the mouse cursor over the desired option. With the
keyboard, use TAB or SHIFT+TAB to move between options. When
you have made your selections move the cursor to the OK
button and press ENTER (or click the left mouse button). The
options are:
Generate coordinates using:
You can generate the source file using actual screen
position coordinates or relative coordinates. By
selecting the #define option, SSG will write a define
statement with the relative position information. You
can later modify this define to change the position of
your objects.
Generate colors using:
This option lets you select how the color values will
be written to your source files. By selecting the
Predefined variables option the instructions will be
written using the previously defined color variables.
By selecting the Actual values option the instructions
will ne written using the actual color values used when
building the screen (see "Define Color Variables").
Add headers files
When this option is tagged your source file will
contain the SCL1 #include headers.
Add Color variables
When this option is tagged the previously defined color
variables will be written to your source file.
Generating Source Files
Once you have specified the Source-Generation options the
Source Generation Menu will be presented in the lower left
corner of your screen. It has four options:
Page -11-
SSG Version 2.0 - Reference Manual
Add object
Select this option to define an object in your screen.
An object can be a window, a menu, a string, a field,
etc. SSG will present a list of supported objects from
which you can select the desired one.
Done
Select this option when no more objects need to be
defined.
Redo
Discard the last defined object.
View
Select this option to view the source code being
generated by SSG.
When you select the "Add Object" option, an object list
appears in the center of the screen. The list contains the
different functions the SSG can program for you. The source
code will be written exactly as you instruct SSG. You have
to be careful to select the desired function in the correct
order.
When you select an object from this list, SSG will prompt
you for the necessary information, such as; marking the
affected area, indicating the colors, etc.
SSG will write the source code using the SCL1 functions. The
available objects refer to these functions. Refer to the
SCL1 reference manual for a detailed description of each
supported function.
The available objects are:
BigCursor - Will write the source code for changing the
cursor size to a block.
Box - Will write the source code for drawing a box, SSG
will read from the screen the frame type and box
position. You will be prompted to mark the box area.
Various options are available:
Box - plain box.
Page -12-
SSG Version 2.0 - Reference Manual
Box (Grow) - box that will grow.
Box (Shadow) - box with shadow effect.
Box (Sound) - box drawn with sound effect.
Box (Grow+Shadow) - growing box with shadow
effects.
Box (Grow+Sound) - growing box with sound effects.
Box (Grow+Shadow+Sound) - growing box with both
shadow and sound effects.
Box Line - Will write the data and call to the
DrawBoxLine function according to the marked area.
This will draw a line with correct termination
characters inside a Box. SSG will read the
corresponding line type from the screen.
Calendar - Will write the source code for the structure
and a call to the calendar function with the C_RESET,
C_DRAW and C_BROWSE messages.
Calendar (structure) - Will write only the Calendar
structure according to the position and color
information selected.
Clear Area - Will write a Cls function to clear a
screen area. SSG will determine the area coordinates
from the area you mark when prompted.
CursorOff - Will write a CursorOff function call to the
source code.
CursorOn - Will write a CursorOn function call to the
source code.
DrawLine - Will write the data and call to the DrawLine
function according to the marked area.
Fields - Will write to the source file, the required
structure and function call to make a data entry screen
using the Fields function. SSG will prompt you to mark
each field prompt and input area. If you want to
include a validation or help function you must add the
function's name to the finished source code.
Page -13-
SSG Version 2.0 - Reference Manual
Fields2 - Will write to the source file, the required
structure and function call to make a data entry screen
using the Fields2 function. SSG will prompt you to
indicate each field type, then it will prompt for the
field information in a pop-up window. If you want to
include a validation or help function you must add the
function's name to the finished source code.
FillBlock - Will write the source code for a call to
the FillBlock function. The fill character, position
coordinates and colors will be read from the screen.
Function Name - Will prompt you for the function name
and will insert it in the source code with an opening
brace. For example, to begin a program you can type in
the "main" name when prompted.
Function Close - Will add the closing brace to the
source code.
Get String - Will write to the source file a function
call for getting a string from the console using the
GetString function.
HideMouse - Will write a HideMouse function call to the
source code.
InitMouse - Will write a InitMouse function call to the
source code.
LineEditor - Will write to the source file the
structures and a call to the LineEditor function. You
will be prompted to mark the prompt and field areas and
the field options.
LineEditor (structure) - Will create a LineEditor
structure according to the information supplied.
ListWindow - Will write to the source file the data and
a call to the ListWindow function. You will be
prompted to mark the display area.
ListWindow (structure) - Will create a ListWindow
structure according to the information supplied.
Menu - Will write to the source file a call to the Menu
function. You will be prompted to mark each of the menu
selection items, to indicate the menu structure name
and the normal, reverse and highlight colors.
Page -14-
SSG Version 2.0 - Reference Manual
MenuSystem - Will write to the source file the
structures and a call to the MenuSystem function. You
will be asked if you want a shadow effect on the pull-
down menus, if you will access them with an ALT+key
keyboard input and if you want to draw lines in empty
spaces. You will then be prompted to mark the top-bar
menu area and each option. To permit good mouse
interface mark each option with one space before and
after each option's text and do not leave spaces
between them. You will be asked to press the keyboard
combination that will pull-down the menu for that
option. Then you are required to mark each pull down
menu area and menu options.
MenuSystem (structure) - Will create a MenuSystem
structure according to the supplied information.
MouseMenu - Will write to the source file a structure
and a call to the MouseMenu function. You will be
prompted to mark each of the menu selection items, to
indicate the menu structure name and the reversed
color.
MouseButton - Will write to the source file a call to
the MouseButton function.
MouseButton (structure) - Will create a MouseButton
structure according to the supplied information.
ScreenDump - Will write to the source file a set of
character/attribute codes for each of the screen
positions enclosed in the marked area. With this call
you can write the code to duplicate a complex screen.
ScrollWindow - Will write to the source file a call to
the ScrollWindow function. You will be prompted to
mark the display area.
ScrollWindow (structure) - Will create a ScrollWindow
structure according to the information supplied.
Shadow (solid color) - Will add a function call to draw
a solid color shadow effect to the marked area.
Shadow (XOR'ed) - Will add a function call to draw an
XOR'ed shadow effect to the marked area.
ShowMouse - Will write the source code for displaying
the mouse.
Page -15-
SSG Version 2.0 - Reference Manual
Select - Will write to the source file a call to the
Select function.
Select (structure) - Will create a Select structure
according to the supplied information.
SetVideoMode - Will write a SetVideoMode function call
to the source code.
Set EGA/VGA 25 - Will write the source code for
changing the video mode to 25 lines display.
Set EGA/VGA 43/50 - Will write the source code for
changing the video mode to 43/50 lines display.
TagItem - Will write to the source file a call to the
TagItem function.
TagItem (structure) - Will create a TagItem structure
according to the supplied information.
Window (open+clear area) - Will add a function call to
open a window and clear the screen area. You will be
prompted for the window buffer name. The window buffer
size is computed by SSG (The maximum number of windows
that SSG can open is 20).
Window (open only) - Will add a function call to open a
window. You will be prompted for the window buffer
name. The window buffer size is computed by SSG (The
maximum number of windows that SSG can open is 20).
Window(Close) - Will close a previously opened window
and will restore the previous screen contents.
WriteChar(s) - Will add a function call to the
WriteChar function. The code written will select the
character at the cursor position.
WriteScreen - Will write the source code to write a
string to the screen.
When you have finished generating your source code you can
exit the "Source Generating Menu" by selecting the "Done"
option. If SSG has generated at least one line of source
code, the "Save File", "View Source" and "New" options will
be added to the SOURCE MENU. This menu will now look like
this:
Page -16-
SSG Version 2.0 - Reference Manual
+---------|Source|---------+
| Define Color Variables |
| |
| Generate Screen |
| |
| Save File |
| |
| View Source |
| |
| New |
+--------------------------+
The new options added are self explanatory.
Video Menu
To select the Video Menu press the ALT+V keyboard combination or
click your mouse after pointing to the Video keyword in the
STATUS BOX. Everything related to video modes, colors, etc. is
found in this menu.
+---------|Video|----------+
| Select Color |
| Pick Screen Color |
| Modify Block Color |
| Block to Default Color |
| |
| Switch Screen |
| View |
| |
| 40 columns x 25 lines |
| 80 columns x 25 lines |
| 80 columns x 50 lines |
+--------------------------+
Select Color
When you select this option a "Color Selection Table" will
appear in the screen. Use your keyboard or the mouse to
select the desired color.
Pick Screen Color
This option lets you "pick" or select the default color from
the screen by clicking the mouse or pressing ENTER after
moving the cursor over the desired color.
Page -17-
SSG Version 2.0 - Reference Manual
Modify Block Color
When you select "Modify Block Color" option a window will
appear. As with most block operations the marked block will
be highlighted, use the Up and Down arrow keys to change
the foreground color. By pressing TAB you can toggle
between foreground and background. You can toggle as many
times as you like between foreground and background. Press
the Spacebar to toggle blinking on/off. Press ENTER to exit
with new colors or ESC to restore original colors.
Block to Default Color
This option will change a marked block's color to the
default color.
Switch Screen
SSG has two working screens. These screens can hold
different information. You can transfer information between
screens. Both screen need no to be configured in the same
video mode. With this option you can switch the active
screen.
View
This option permits you to view the contents of both edit
screens. Both the mouse and the text cursors and the STATUS
BOX are removed form the screen.
Change Video Mode
The video modes available in your system will be displayed
as, for example: 40 columns x 25 lines, 80 columns x 25
lines or 80 columns x 50 lines. You can pick any of the
available video modes with your keyboard or mouse.
STEP BY STEP EXAMPLE
The best way to learn about is SSG is to actually build a screen
and generate a program source. The following instructions will
guide you, step by step, through this process. We will now do
three step-by-step examples of programs built with the aid of
SSG.
Page -18-
SSG Version 2.0 - Reference Manual
Example #1 - Menu
- Start SSG.
- Move the cursor to row 1, column 4.
- Change the character translation table to the text mode (by
pressing F4 or clicking your mouse after pointing to the
arrow icon). Type "MAIN MENU"
- Move the cursor to row 3, column 2. Type "First Option".
Move the cursor to row 4, column 2 and type "Second Option.
Continue incrementing the row position, aligning the column
position and type "Third Option", "Fourth Option" and "Fifth
Option". Move the cursor to row 9, column 2 and type
"Exit".
- Mark a block to surround the Menu, leave space for drawing a
box around it. The block should begin at row 0, column 0
and end at row 10, column 16 (or it can be marked from row
10, column 16 to row 0, column 0).
- From the "Edit Menu" select the "Draw Box" option. Select a
double line box frame. Mark a new block starting at row 2,
column 0 to column 16. Select the "DrawBoxLine" option from
the "Edit Menu".
- Mark the whole block again and select the "Center Block"
option from the "Edit Menu". Center the block both
horizontally and vertically.
- Note the you have three options starting with the letter
"F". We must tell SSG what key will be used as a Hot-Key.
Select the "Select Color" option from the "Video Menu" and
select black background with highlighted white characters.
Now move the cursor to the "F" in the "First Option" and
type "F". Do the same with the "S" in "Second Option", the
"T" in "Third Option", the"o" in "Fourth Option", the "i" in
"Fifth Option", and the "E" in "Exit".
- Now we are ready to generate the source code. Select the
"Generate Screen" option from the "Source Menu". Tag the
following options: Actual coordinates, Predefined
variables, Add headers files and Add Color variables.
- You will be prompted to indicate the screen name, type Menu.
- Select the "Add Object" option. Select the "Function Name"
option, when prompted indicate the function name as "main".
Page -19-
SSG Version 2.0 - Reference Manual
- Select the "Add Object" option. Select the "Clear Screen
Area" option, when prompted mark a block from row 0, column
0 to row 24, column 79 (the whole screen).
- Select the "Add Object" option. Select the Box (grow)
option. Mark the box area when prompted.
- Select the "Add Object" option. Select the "Box Line"
option. Mark the line area when prompted (the line that
separates the "MAIN MENU" text from the rest of the menu.
- Select the "Add Object" option. Select the "WriteScreen"
option. Mark the text "MAIN MENU".
- Select the "Add Object" option. Select the "Menu" option.
Do not tag any of the display options presented in the Menu
Initialization Prompt. Mark each menu option when prompted.
For a neater look make the length of each selection equal.
When you mark the last menu option ("Exit"), answer the
"Reverse Color" prompt and indicate that you do not want
more options.
- Select the "Add Object" option. Select the "Function Close"
option.
- You have finished writing the source code for the sample
menu. You can take a look at the source code by selecting
the "View" option. To finish the process select the "Done"
option. Save the source file as "SAMPMENU.C" and exit SSG.
It is recommended that the screen be saved for future
practice.
The source file you have just created should look like this:
#include <scl1.h>
#include <scl1keys.h>
/***** Menu DATA *****/
int NColor=7;
int RColor=112;
int HColor=15;
char Menu_str0[]="MAIN MENU";
struct MenuOpt Menu_mo0[]={
10,33,"First Option ",'F',
11,33,"Second Option",'S',
12,33,"Third Option ",'T',
Page -20-
SSG Version 2.0 - Reference Manual
13,33,"Fourth Option",'o',
14,33,"Fifth Option ",'i',
16,33,"Exit ",'E',
};
/***** Menu CODE *****/
main(void)
{
Cls(NColor,0,0,24,79);
GSSBox(NColor,0,7,31,16,47,1,0,0);
DrawBoxLine(NColor,0,9,31,9,47);
WriteScreen(NColor,8,35,Menu_str0);
Cls(NColor,7,31,17,46);
Menu(NColor,RColor,NColor,6,Menu_mo0);
}
Example #2 - MenuSystem
The screen you will need to practice how to generate a MenuSystem
source code has been included in the screen file "SAMPMSYS.SSG".
- Load the SAMPMSYS.SSG screen file into SSG.
- Select the "Generate Screen" option from the "Source Menu".
Tag the following options: Actual coordinates, Predefined
variables, Add headers files and Add Color variables.
- You will be prompted to indicate the screen name, type Msys.
- Select the "Add Object" option. Select the "Function Name"
option, when prompted indicate the function name as "main".
- Select the "Add Object" option. Select the "Clear Screen
Area" option, when prompted mark a block from row 1, column
0 to row 24, column 79 (the whole screen).
- Select the "Add Object" option. Select the "MenuSystem"
option.
- You will be prompted to mark the bar menu area. Mark the
whole top line from column 0 to column 79.
- The Menu System Initialization window will pop into the
screen. Select the "Division Lines" and "ALT Sensitive"
options and the "OK" button.
Page -21-
SSG Version 2.0 - Reference Manual
- You will be prompted to mark each of the bar menu options.
For a better interface mark start the block one character to
the left and finish the block one character to the right of
each bar menu option. Mark the first option "File", you
will be prompted to press the ALT+key combination that will
call this option, press ALT+F. A window will pop asking if
you want more bar menu options. Mark the other two bar menu
options using the same procedure, this time indicating the
ALT+O and ALT+E key combinations (for "Options" and "Exit").
- After finishing defining the bar menu you will be prompted
to define each individual pull down menu. The procedure is
identical to that used in the Menu example.
- After completing the Menu System definition select the
"Function Close" object to finish the source code generation
process. The generated code will look like this:
#include <scl1.h>
#include <scl1keys.h>
/***** Msys DATA *****/
int NColor=7;
int RColor=112;
int HColor=15;
int Mess;
MSBar Msys_msb0[]={
1,6,0x2100," File ",
7,15,0x1800," Options ",
16,21,0x1200," Exit ",
};
MSOptions Msys_mso0[]={
2,2,"Open ",'O',
3,2,"Close ",'C',
5,2,"Delete ",'D',
6,2,"Copy ",'o',
7,2,"Compare",'m',
};
MSOptions Msys_mso1[]={
2,8,"Toggle Verify ",'T',
3,8,"Select Drive ",'S',
4,8,"Select Directory",'e',
6,8,"Backup ",'B',
7,8,"Restore ",'R',
};
Page -22-
SSG Version 2.0 - Reference Manual
MSOptions Msys_mso2[]={
2,17,"Help ",'H',
4,17,"Continue",'C',
6,17,"Quit ",'Q',
};
char ms0_wbuf[378];
MSWindow Msys_msw0[]={
1,0,8,10,5,ms0_wbuf,Msys_mso0,
1,6,8,25,5,ms0_wbuf,Msys_mso1,
1,15,7,26,3,ms0_wbuf,Msys_mso2,
};
MSData Msys_msd0={112,15,7,112,15,Msys_msb0,Msys_msw0,3,0,0,0};
/***** Msys CODE *****/
main(void)
{
Cls(RColor,0,0,24,79);
MenuSystem(MS_SHADOW_ON,(MSData *)0);
MenuSystem(MS_LINE_ON,(MSData *)0);
MenuSystem(MS_ALT_ON,(MSData *)0);
MenuSystem(MS_DRAW,&Msys_msd0);
do
{
if(Mess=KeyReady())
{
Mess=MenuSystem(MS_KEY,&Msys_msd0,Mess);
if(KeyReady())
GetKey();
}
else
Mess=MenuSystem(MS_CHECK,&Msys_msd0);
}while(Mess != MS_SELECT && Mess != MS_CANCEL);
}
SSG assumed that the exit condition will be the first option of
the first pull-down menu. In this example this condition will be
the third option of the third menu. You should edit the last
line of our sample source code to read this:
}while(Msys_msd0!=3 || Msys_msd0.Option!=3);
You can now compile and run the sample Menu System.
Page -23-
SSG Version 2.0 - Reference Manual
Example #3 - Fields2
The screen you will need to practice how to generate a Field2
source code has been included in the screen file "SAMPFLD2.SSG".
- Load the SAMPFLD2.SSG screen file into SSG.
- Select the "Generate Screen" option from the "Source Menu".
Tag the following options: Actual coordinates, Predefined
variables, Add headers files and Add Color variables.
- You will be prompted to indicate the screen name, type Fld.
- Select the "Add Object" option. Select the "Function Name"
option, when prompted indicate the function name as "main".
- Select the "Add Object" option. Select the "Clear Screen
Area" option, when prompted mark a block from row 0, column
0 to row 24, column 79 (the whole screen).
- Select the "Add Object" option. Select the "Box" object and
mark the box area. Then, using the "Box Line" object mark
the two interior lines inside the box (one horizontal and
one one vertical).
- Select the "Add Object" option. Select the "WriteScreen"
object and mark the "STUDENT RECORD" screen title. Select
this object again and mark the "Member of:" prompt. (the
other prompts will be defined when the corresponding fields
are defined)
- Select the "Add Object" option. Select the "Fields2"
option. You will be presented with a list of field types.
Select the "Line Editor" field type, you will be prompted to
mark the prompt area, mark the prompt "Name:". The you will
be prompted to mark the data entry area. After marking the
data entry area you will be prompted to tag the Line Editor
options, since this field can have any characters and does
not need any formatting, keep the default options.
- You will now need to define the other fields. The
"Address:", "City:", "State:" and "Zip:" fields are all of
the Line Editor type. The only difference are the options
that we need to specify. For the "State:" field we can
select the "Capitalize" option.
Page -24-
SSG Version 2.0 - Reference Manual
- The "Sex" field is of the "Select" type. You will be
prompted to mark the option strings. Mark just the text and
not the parenthesis. When prompted if you want a field
prompt, answer yes and mark the "Sex:" prompt.
- The next three fields are of the Line Editor type. For the
"Student Number" and "Age" fields we can specify "Digits" as
the acceptable characters. For the "Date Admitted" we can
specify a "Formatted" type field with the "/" format
character.
- The next field is of the "Select" type. Proceed as explained
above.
- The "Member of:" field can have any number of options tagged
so it is not of the Select type. We must define each
available option as a "TagItem" field type. In this case we
must select the "TagItem" field type six times and mark the
field string for each option.
- The "Grade Category:" field is of the "Select" type.
Proceed as explained above.
- The remaining fields are of the "MouseButton" type. After
selecting the MouseButton option you will be prompted to
mark the area and the text for each option.
- After defining all three MouseButtons instruct SSG that you
do not want any more fields. The select the "Function
Close" object.
#include <scl1.h>
#include <scl1keys.h>
/***** Fld DATA *****/
int NColor=7;
int RColor=112;
int HColor=15;
char Fld_str0[]="STUDENT RECORD";
char Fld_str1[]="Member of:";
char Fld_ledbuf0[40];
LEData Fld_led0={
7,6,4,"Name:",7,6,10,39,39,CC_ANY,0,0,Fld_ledbuf0,0,0,0,
2,1,0,0,0,0,0,0,0};
char Fld_ledbuf1[37];
Page -25-
SSG Version 2.0 - Reference Manual
LEData Fld_led1={
7,8,4,"Address:",7,8,13,36,36,CC_ANY,0,0,Fld_ledbuf1,
0,0,0,2,1,0,0,0,0,0,0,0};
char Fld_ledbuf2[11];
LEData Fld_led2={
7,10,4,"City:",7,10,10,10,10,CC_ANY,0,0,Fld_ledbuf2,
0,0,0,2,1,0,0,0,0,0,0,0};
char Fld_ledbuf3[3];
LEData Fld_led3={
7,10,22,"State:",7,10,29,2,2,CC_ANY | CC_CAPITALIZE,
0,0,Fld_ledbuf3,0,0,0,2,1,0,0,0,0,0,0,0};
char Fld_ledbuf4[11];
LEData Fld_led4={
7,10,34,"Zip:",7,10,39,10,10,CC_ANY,0,0,Fld_ledbuf4,
0,0,0,2,1,0,0,0,0,0,0,0};
SData1 Fld_sd1_0[]={
12,9,"Male",
12,19,"Female",
0};
SData2 Fld_sd2_0={7,12,4,"Sex: 0,0,0,0};
char Fld_ledbuf5[8];
LEData Fld_led5={
7,14,4,"Student Number :",7,14,21,7,7,CC_DIGIT,
0,0,Fld_ledbuf5,0,0,0,2,1,0,0,0,0,0,0,0};
char Fld_ledbuf6[5];
LEData Fld_led6={
7,14,31,"Age:",7,14,36,4,4,CC_DIGIT,0,0,Fld_ledbuf6,
0,0,0,2,1,0,0,0,0,0,0,0};
char Fld_ledbuf7[9];
LEData Fld_led7={
7,16,4,"Date Admitted :",7,16,20,8,8,CC_DIGIT,0,
0,Fld_ledbuf7,"/",0,0,2,1,0,0,0,0,0,0,0};
SData1 Fld_sd1_1[]={
18,22,"Full Time",
18,36,"Part Time",
0};
SData2 Fld_sd2_1={7,18,4,"Type of Student: 0,0,0,0};
TIData Fld_ti0={7,7,56,0,"Honor Society",0,0};
TIData Fld_ti1={7,8,56,0,"Basketball Team",0,0};
Page -26-
SSG Version 2.0 - Reference Manual
TIData Fld_ti2={7,9,56,0,"Photography Club",0,0};
TIData Fld_ti3={7,10,56,0,"Oratory Club",0,0};
TIData Fld_ti4={7,11,56,0,"Drama Club",0,0};
TIData Fld_ti5={7,12,56,0,"Radio Club",0,0};
SData1 Fld_sd1_2[]={
15,56,"1.0 to 1.5",
16,56,"1.5 to 2.0",
17,56,"2.0 to 2.5",
18,56,"2.5 to 3.0",
19,56,"3.0 to 3.5",
20,56,"3.5 to 4.0",
0};
SData2 Fld_sd2_2={7,14,56,"Grade Category:0,0,0,0};
MBData Fld_mb0={7,112,21,5,21,17,21,6,"NEXT RECORD",0,0,0,0};
MBData Fld_mb1={7,112,21,21,21,37,21,22,"PREVIOUS
RECORD",0,0,0,0};
MBData Fld_mb2={7,112,21,42,21,47,21,43,"QUIT",0,0,0,0};
FData1 Fld_fd1_0[]={
LINE_EDITOR,&Fld_led0,0,FieldCheck,
LINE_EDITOR,&Fld_led1,0,FieldCheck,
LINE_EDITOR,&Fld_led2,0,FieldCheck,
LINE_EDITOR,&Fld_led3,0,FieldCheck,
LINE_EDITOR,&Fld_led4,0,FieldCheck,
SELECT,Fld_sd1_0,&Fld_sd2_0,FieldCheck,
LINE_EDITOR,&Fld_led5,0,FieldCheck,
LINE_EDITOR,&Fld_led6,0,FieldCheck,
LINE_EDITOR,&Fld_led7,0,FieldCheck,
SELECT,Fld_sd1_1,&Fld_sd2_1,FieldCheck,
TAG_ITEM,&Fld_ti0,0,FieldCheck,
TAG_ITEM,&Fld_ti1,0,FieldCheck,
TAG_ITEM,&Fld_ti2,0,FieldCheck,
TAG_ITEM,&Fld_ti3,0,FieldCheck,
TAG_ITEM,&Fld_ti4,0,FieldCheck,
TAG_ITEM,&Fld_ti5,0,FieldCheck,
SELECT,Fld_sd1_2,&Fld_sd2_2,FieldCheck,
MOUSE_BUTTON,&Fld_mb0,0,FieldCheck,
MOUSE_BUTTON,&Fld_mb1,0,FieldCheck,
MOUSE_BUTTON,&Fld_mb2,0,FieldCheck,
0};
FData2 Fld_fd2_0;
/***** Fld CODE *****/
Page -27-
SSG Version 2.0 - Reference Manual
main(void)
{
Cls(NColor,0,0,24,79);
Box(NColor,0,2,0,22,79);
DrawBoxLine(NColor,0,4,0,4,79);
DrawBoxLine(NColor,12,4,52,22,52);
WriteScreen(NColor,3,33,Fld_str0);
WriteScreen(NColor,6,56,Fld_str1);
Fields2(F_INIT,Fld_fd1_0,&Fld_fd2_0);
Fields2(F_COLORS,Fld_fd1_0,&Fld_fd2_0,NColor,RColor);
Fields2(F_DRAW,Fld_fd1_0,&Fld_fd2_0);
Fields2(F_ACTIVE,Fld_fd1_0,&Fld_fd2_0);
}
As you can see, the example programs are almost completely
written for you. The file created by SSG will contain all the
data and code needed to produce the screens. Your program is
ready to be compiled. Of course, most of the times you will want
to modify, add or continue programming using the structures
created for you by SSG.
LICENSE
SSG is a copyrighted material and is NOT a Shareware or User
Supported product. SSG is supplied to all registered users of the
SCL1 library, as part of the registration package and should not
be freely distributed or copied except for backup purposes. All
registered users are granted a non exclusive license to use this
program for any use. The Shareware version of the SCL1 library
(which does not include SSG) may be freely distributed.
This program has been thoroughly tested and, to the best of our
knowledge, perform as this documentation describe. We cannot
accept any responsibility for any problems which may occur
through its use. After examining this document and other included
file, if you feel that this program is not suitable for your use,
please do not use it.
DISCLAIMER
THIS SOFTWARE AND MANUAL ARE SOLD "AS IS" AND WITHOUT WARRANTIES
AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES
WHETHER EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS HARDWARE AND
SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE PUT, NO
WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
Page -28-
SSG Version 2.0 - Reference Manual
GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE
THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT.
THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM. ANY
LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT
REPLACEMENT OR REFUND OF PURCHASE PRICE.
Feel free to send any comments or suggestions. If you find any
bugs please let us know so that they can be traced and fixed.
Please include with your comments any relevant information, such
as; hardware configuration, description of the bug or problem and
if possible a section of the problem code. Write to:
José Rodríguez Alvira
El Monte Sur 190, Apt. B-342,
Hato Rey, Puerto Rico, 00918
The latest version of SCL1, sample programs and comments about
these programs are available in:
TECH BBS (Sysop: José Romero)
(809)732-2322
You can leave any comments, suggestions or questions in this BBS.
We will reply these messages in the same BBS.
Page -29-